<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>双向绑定</title>
</head>
<body>
    <div id="app">
        <!-- 父组件传值给子组件(将i传递给这个子组件的变量haha)，使用props接受参数，使用v-bind绑定变量 -->
        <zhangsan v-for="i in list" :haha="i"></zhangsan>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

    <script>
        Vue.component("zhangsan",{
            props:["haha"],
            template:'<li>{{haha}}</li>'
                
        })
        
        var vue =new Vue({
            el:"#app",
            data:{
                info:"waiting",
                list:["1","2","3","5"]
            },
            methods:{
            }
        
        })  
    </script>
</body>
</html>